<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=100%,initial-scale=1" />
<link rel="stylesheet" href="css/login.css" type="text/css" />
<title>无标题文档</title>
<script type="text/javascript">
function $$(id) {
    return document.getElementById(id);
}
//页面加载时调用的函数
function pageload() {
    var strName = localStorage.getItem("keyName");
    var strPass = localStorage.getItem("keyPass");
    if (strName) {
        $$("txtName").value = strName;
    }
    if (strPass) {
        $$("txtPass").value = strPass;
    }
}
//点击“登录”按钮后调用的函数
function btnLogin_click() {
    var strName = $$("txtName").value
    var strPass = $$("txtPass").value;
    localStorage.setItem("keyName", strName);
    if ($$("chkSave").checked) {
        localStorage.setItem("keyPass", strPass);
    } else {
        localStorage.removeItem("keyPass");
    }
    $$("spnStatus").className = "status";
    $$("spnStatus").innerHTML = "登录成功！";
}
</script>
</head>

<body>
<div class="center">
  <div id="box"><img src="timg.jpg" width="150"/></div><p>
  <div id="top">
     <div id="p1"><input id="txtName" type="text" placeholder="请输入账号/手机号" ></div>
     <div><input id="txtPass" type="password" placeholder="请输密码" ></div>
     <p>
     <div>
         <div><input id="txtSms" type="password" placeholder="输入验证码" ></div>
         <div><input id="getSmsBtn" type="button"value="获取"></input>
      </div>
      <p>
      <div>    <input id="chkSave" type="checkbox">
               记住密码！</div>
      <div>  
          <input id="loginBtn" type="button" value="登录" onclick="btnLogin_click()"/>
          <input id="loginBtn" type="button" value="注册" />
      </div>
      </div>
      <div><a href="#">忘记密码</a></div>
      <div id="spnStatus"></div>
</div>
</body>
</html>
